﻿@{
    Layout = "~/Views/Shared/_LayoutList.cshtml";
}
@(Html.nbGridFor<EnumItem>(s =>
{
    s.Action(@Url.Action("SubItemList", new { ParentId = ViewBag.ParentId }));
    s.Columns(c =>
    {
        c.Bind(m => m.Id).IsKey();
        c.Bind(m => m.EnumCode).Width(80).Align(GridAlign.Left).AsQuery();
        c.Bind(m => m.EnumName).Align(GridAlign.Left).AsQuery();
        c.Bind(m => m.FirstChar).Align(GridAlign.Left).Width(80).AsQuery();
        c.Bind(m => m.SeqNo).Width(40);
        c.Bind(m => m.Remark).Align(GridAlign.Left).Width("auto");
        c.Bind(m => m.UpdateUser).Width(60);
        c.BindDateTime(m => m.UpdateDate);
        c.BindTemplate(190)
            .Template(Url.GridRowEditLink("编辑枚举项", "EditSubItem"))
            .Template(Url.GridRowDeleteLink("EnumName"))
            .Template(@<a class="imgbtn2" href="@Url.OpenDialog(Url.Action("SubItem", new { parentId = "${Id}" }), "子枚举项列表（${EnumName}）", new { width = 850 })"><span
                class="Add">添加子枚举</span></a>);
    });
    s.Buttons(b =>
    {
        b.BindAddButton("新建枚举项").Action(Url.Action("EditSubItem", new { parentId = ViewBag.ParentId }));
        b.BindDeleteButton();
    });
}))
